<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<s:head theme="ajax"/>
		<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet" type="text/css" href="../css/topics.css">
		<title>教师出题</title>
		<script type="text/javascript">
		function validateAll()
		{
		  if(document.frm.subjectName.value==null||document.frm.subjectName.value=="")
		  {
		    alert("请您认真填写课题名称,此项为必填项");
		    return false;
		  }
		  if(document.frm.subjectContent.value==""||document.frm.subjectContent.value==null)
		  {
		  alert("请您认真填写课题内容，此项为必填项");
		  return false;
		  }
		   if(document.frm.subjectRequest.value==""||document.frm.subjectRequest.value==null)
		  {
		  alert("请您认真填写课题要求，此项为必填项");
		  return false;
		  }
		   if(document.frm.subjectType.value=="true")
		  {
		  alert("请您认真选择课题类型，此项为必选项");
		  return false;
		  }
		    if(document.getElementById('form_rightName_professionalNum').length<2)
		  {
		  alert("请您认真选择面向专业，此项为必选项");
		  return false;
		  }
		  
		
		}
		</script>
	</head>
	<body>
		<s:form action="insertSubjects" name="frm" method="post" id="form" theme="simple" onsubmit="return validateAll()">
		
		
			<table>

				<tr>
					<td id="tdId1">
						课题名称：
					</td>
					<td>
						<s:textfield name="subjectName" id="subjectName" label="课题名称"
							size="50">
						</s:textfield>
					</td>



				</tr>
				<tr>
					<td>
						课题内容：
					</td>
					<td>
						<s:textarea name="subjectContent" id="subjectContent">
						</s:textarea>
					</td>
				</tr>

				<tr>
					<td>
						课题要求：
					</td>
					<td>
						<s:textarea name="subjectRequest" id="subjectRequest">
						</s:textarea>
					</td>
				</tr>
				
				<tr>
					<td>
						课题类别：
					</td>
					<td>
						
						<s:select headerKey="true" headerValue="----------请选择类别----------" name="subjectType.topicsClassNum" id="subjectType" list="topicsClass" listKey="topicsClassNum" listValue="topicsClassName"/>
					</td>
				</tr>
				
			<s:optiontransferselect id="choiceSubject"
			    label="面向专业" 
				name="leftName.professionalNum"
				leftTitle="可选专业："
				rightTitle="已选专业："
				list="leftName"
				listKey="professionalNum"
				listValue="professionalName"
				multiple="true"
				addToLeftLabel="向左移除<-"
				addToRightLabel="向右添加->"
				allowUpDownOnLeft="false"
				rightUpLabel="向上移动"
				rightDownLabel="向下移动"
				selectAllLabel="全选"
				headerKey="XL"
				headerValue="*********请选择该课题面向的专业*********"
				emptyOption="false"
				doubleList="rightName"
				doubleName="rightName.professionalNum"
				doubleListKey="professionalNum"
				doubleListValue="professionalName"
				doubleHeaderKey="XXL"
				doubleHeaderValue="*********请选择要移除的专业（专业优先级从上到下依次降低）*********"
				doubleEmptyOption="false"
				doubleMultiple="true"/>
				
				<tr>
					<td>
						<s:submit name="submit" id="submit" value="确定" align="center" theme="simple" ></s:submit>
					</td>
					<td>
						<s:reset name="cancel" id="cancel" value="取消" align="center" theme="simple"></s:reset>
					</td>
				</tr>
		
			</table>
		</s:form>
	</body>
</html>